export PATH=/home/work_nfs15/asr_data/ckpt/xlgeng/word_seg/openfst-1.6.7/bin:$PATH
export PATH=/home/work_nfs15/asr_data/ckpt/xlgeng/word_seg/fstbin:$PATH
export PATH=/home/work_nfs15/asr_data/ckpt/xlgeng/word_seg/lmbin:$PATH
export PATH=/home/work_nfs15/asr_data/ckpt/xlgeng/word_seg/srilm/path/bin:$PATH
export PATH=/home/work_nfs15/asr_data/ckpt/xlgeng/word_seg/srilm/bin:$PATH
export PATH=/home/work_nfs15/asr_data/ckpt/xlgeng/word_seg/srilm/lm/bin/i686-m64:$PATH


old_lm=/home/node54_tmpdata/xlgeng/code/gxl_ai_utils/eggs/cats_and_dogs/ngram_task/train_ngram/gxl_arpa_zoo/asr_poi_xian/local/lm/lm.arpa
output_dir=./gxl_ngram_zoo/asr_poi_xian

# 这种部署的方式总是报核心坠落的错误，需要在训练的过程中直接加入剪裁系数才行
thres=0.0001
output_lm=$output_dir/thres_"$thres"
mkdir -p $output_lm
order=3
echo "pruning lm with thres $thres"
ngram -lm $old_lm -order $order -prune $thres -write-lm $output_lm/lm.arpa
echo "finish pruning lm with thres $thres"


thres=0.001
output_lm=$output_dir/thres_"$thres"
mkdir -p $output_lm
order=3
echo "pruning lm with thres $thres"
ngram -lm $old_lm -order $order -prune $thres -write-lm $output_lm/lm.arpa
echo "finish pruning lm with thres $thres"


thres=0.01
output_lm=$output_dir/thres_"$thres"
mkdir -p $output_lm
order=3
echo "pruning lm with thres $thres"
ngram -lm $old_lm -order $order -prune $thres -write-lm $output_lm/lm.arpa
echo "finish pruning lm with thres $thres"